<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/3/5
 * Time: 11:55
 */
declare(strict_types=1);

namespace App\Service;
use App\Utils\CustomUtils;
use App\Utils\RedisUtils;

class CommonService
{

    public function tryOneMore($param) {
        if (isset($param['tryTimes']) && $param['tryTimes'] > 2) {
            CustomUtils::xzxDebug("结算失败已达3次，需要人工介入，参数：" . serialize($param));
            return;
        }
        // 失败重试
        $param['tryTimes'] = isset($param['tryTimes']) ? $param['tryTimes'] + 1 : 1;
        $this->addMq($param);
    }

    public function addMq($param) {
        RedisUtils::redisResource()->rPush("MchAccountAccessList", serialize($param));
    }

}